import Axios from '../utils/axios'
import api from '../api'


//团课课程数据=====
function getGroupListData(){
    return Axios.get(api.apihicky.getGroupListData)
}
//团课课表数据=======
function groupClassSchedule(){
    return Axios.get(api.apihicky.groupClassSchedule)
}
//团课课表回显示
function getCourseFindById(id:number){
    return Axios.get(api.apihicky.getCourseFindById+id)
}


//团课课表添加
function getCourseAddCourseSchedule(obj:object){
    return Axios.post(api.apihicky.getCourseAddCourseSchedule,obj)
}
//团课课表编辑
function getCourseUpdateList(id:number,obj:object){
    obj.id=Number(id)
    return Axios.post(api.apihicky.getCourseUpdateList,obj)
}




//团课课程编辑=======
function getGroupCompile(id:number){
    console.log(id)
    return Axios.get(api.apihicky.getGroupCompile,{params:{id}})
}
//团课课程删除
function getGroupListDel(id:number){
    return Axios.delete(api.apihicky.getGroupListDel,{params:{id}})
}
//团课课程模糊查询
function getCourseEnquiry(limit:number,name:string,page:number){
    return Axios.post(api.apihicky.getCourseEnquiry,{limit,name,page})
}
//团课课程添加
function getGroupCourseAdded(data:object){
    // console.log("添加提交数据",data)
    return Axios.post(api.apihicky.getGroupCourseAdded,data)
}
//团课课程编辑
function getGroupCourseEditor(obj:object,id:number){
    obj.id=Number(id)
    // console.log('编辑提交',obj)
    return Axios.post(api.apihicky.getGroupCourseEditor,obj)
  
}
//团课课程教练数据
function getCoachList(){
   return Axios.get(api.apihicky.getCoachList)
 
}

//+`?coachId=${coachId}&limit=${limit}&page=${page}`
//预约记录列表数据=====
function getAppointmentBook(coachId:number,limit:number,page:number){
   return Axios.post(api.apihicky.getAppointmentBook+`?coachId=${coachId}&limit=${limit}&page=${page}`)
}
//预约记录用户信息=========
function getAppointmentBookAll(bookId:number){
   return Axios.post(api.apihicky.getAppointmentBookAll+`?bookId=${bookId}`)
}

//预约用户签到========
function getUserCheckIn(id:number){
   return Axios.get(api.apihicky.getUserCheckIn,{params:{id}})
}
//取消预约
function getCancel(id:number){
   return Axios.get(api.apihicky.getCancel,{params:{id}})
}
//预约记录课程信息
function getScheduleId(scheduleId:number){
    return Axios.get(api.apihicky.getScheduleId,{params:{scheduleId}})
 }
export default{
    getGroupCompile,
    getAppointmentBook,
    getAppointmentBookAll,
    getUserCheckIn,
    getCancel,
    getGroupListData,
    groupClassSchedule,
    getGroupListDel,
    getCourseEnquiry,
    getScheduleId,
    getGroupCourseAdded,
    getGroupCourseEditor,
    getCoachList,
    getCourseFindById,
    getCourseAddCourseSchedule,
 getCourseUpdateList

}